package com.czw.ddm.register

import cn.jiguang.api.utils.JCollectionAuth
import cn.jpush.android.api.JPushInterface
import com.didi.drouter.annotation.Service
import com.mtzqc.common.app.App
import com.mtzqc.common.init.InitService

@Service(
    function = [InitService::class],
    priority = 50
)
class PushRegister : JGRegister(), InitService {
    override val depName: String
        get() = "JPush"

    override val dependsLib: Array<Class<out InitService>>?
        get() = null

    override fun initOnAgree(): Boolean {
        JCollectionAuth.setAuth(App.app(), true)
        JPushInterface.setDebugMode(App.isDev() || App.isDebug())
        JPushInterface.init(App.app())
        return true
    }
}